
//宝宝进出园记录
$(document).ready(function(){
	$("#inOutParkInfo").jqGrid({
		url:global_url+global_urijs+'classessinoutpark_searchUIIList'+global_suffix+"?cid="+global_cid,                
		datatype:"json",                
		mtype:'GET', 
		height:'360',
		width:'770',
		colNames:['学生姓名','进园/出园','日期','照片','照片地址','类型','uid'],                
		colModel:[                    
		{name:'name_student',index:'name_student',width:150,align:'center', sortable:false},                    
		{name:'type_str',index:'type_str',width:150,align:'center', sortable:false},                    
		{name:'cdate_str',index:'cdate_str',width:200,align:'center', sortable:false},
		{name:'option',index:'option',width:160,align:'center', sortable:false},
		{name:'img',index:'img',width:120,align:'center',sortable:false,hidden:true},
		{name:'type',index:'type',width:120,align:'center',sortable:false,hidden:true},
		{name:'uid',index:'uid',hidden:true}
		],
		//autowidth:true,
		jsonReader: {
			root:"stuIcardInfList",
			page: "page",
			total: "page_count",
			records : "count",
			repeatitems: false
		},
		pager: jQuery('#inOutParkPage'),
		prmNames : {page:"page",sort: "sort"},
		rowNum: 10,
		//rowList: [10, 20, 30],
		sortname: 'ctime_str',
		hidegrid: false,
		sortorder: 'desc',
		viewrecords: true,
		caption: '学生进出园记录',
		gridComplete:function(){
			var ids=jQuery("#inOutParkInfo").jqGrid('getDataIDs');
			for(var i=0; i<ids.length; i++){
				var id=ids[i];   
				var img_url = jQuery("#inOutParkInfo").jqGrid('getRowData', id).img;
				var type = jQuery("#inOutParkInfo").jqGrid('getRowData', id).type;
				var urlpath = global_userin_url;
				if(type==2){
					urlpath = global_userout_url;
				}
				if(img_url==null||img_url==""){
					ifo = "";
				}else{
					ifo = "<a href='"+urlpath+img_url+"' class='jqtrow' target='_blank'><img src='"+urlpath+"small/"+img_url+"' height='30px' width='30px'></a>";
				}
				jQuery("#inOutParkInfo").jqGrid('setRowData', ids[i],{option:ifo});
			}
		}
	}).navGrid("#inOutParkPage", { edit: false, add: false, del: false, search: false });

});
